package com.example.demo.utils;


import java.util.regex.Pattern;

public class ValueUtils {

    public static boolean isEmpty(String str) {
        boolean flag = false;
        if (str != null && !str.equals("")) {
            flag = true;
        }

        return flag;
    }


    public static boolean isMobile(String number) {
        String num = "[1][34578]\\d{9}";
        if (Pattern.matches(num, number)) {
            return false;
        } else {
            //matches():字符串是否在给定的正则表达式匹配
            return true;
        }
    }

    public static String isName(String customerName) {
        if (Pattern.matches("[\u4e00-\u9fa5]{2,}", customerName)) {
            return customerName;
        } else {
            System.out.println("输入格式错误,请重新输入");
        }
        return customerName;
    }

}
